package com.jlkf.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jlkf.dao.VideoDao;
import com.jlkf.pojo.TblLesson;
import com.jlkf.service.VideoService;
import com.platform.server.response.response.pojo.ReturnData;

@Service
public class VideoServiceImpl implements VideoService {

	@Autowired
	private VideoDao videoDao;
	
	/**
	 * 查看视频列表
	 */
	@Override
	public List<Map<String,Object>> selectVideoList(Map<String, Object> map) {
		return videoDao.selectVideoList(map);
	}

	/**
	 * 删除视频
	 */
	@Override
	public int deleteVideo(String id) {
		return videoDao.deleteVideo(id);
	}

	/**
	 * 添加视频
	 */
	@Override
	public int insertVideo(Map<String, Object> map) {
		return videoDao.insertVideo(map);
	}
	
	/**
	 * 编辑视频
	 */
	@Override
	public int updateVideo(Map<String, Object> map) {
		return videoDao.updateVideo(map);
	}

	/**
	 * 查看视频名称是否已经存在
	 */
	@Override
	public int selectVideoName(String G_LESSON_NAME) {
		return videoDao.selectVideoName(G_LESSON_NAME);
	}

	/**
	 * 导入视频
	 */
	@Override
	public ReturnData readExcel(TblLesson tblLesson) {
		int flag = videoDao.readExcel(tblLesson);
		if(flag == 1){
			return new ReturnData(200,"添加成功");
		}else{
			return new ReturnData(100,"添加失败");
		}
	}


}
